package com.burgeon.backend.mappers;

import com.burgeon.backend.entity.BatchCouponState;
import com.burgeon.backend.entity.Coupon;
import com.burgeon.backend.entity.CouponType;

import java.util.List;

public interface CouponMapper {

    List<Coupon> findCouponByPhone(String phone, String token);

    int findCouponCount(String token);

    //兑换用券
    List<CouponType> ConversionCoupon(String token);

    Coupon FindCouponByCode(String code, String account);

    Coupon FindCouponById(String id);

    //创建记录
    Integer InsertBatchCouponState(int total, String date, String state, String account);

    //重启记录
    Integer RestartBatchCouponState(int total, String date, String state, String account);

    //更新记录
    Integer UpdataBatchCouponState(int succeed, int unfinished, int defeated, String account);

    //结束记录
    Integer OvertBatchCouponState(String date, String state, String account);

    //获取记录
    BatchCouponState GetBatchCouponState(String account);

    //*************************************************

    List<Coupon> getCoupon(String account, Integer start);

    Integer addCoupon(Coupon coupon);

    Integer delCoupon(String id);

    //***************************************************************

    Integer addCouponType(CouponType couponType) throws Exception;

    List<CouponType> getCouponType(String account);

    Integer delCouponType(String id);

    Integer modCouponType(CouponType couponType);

    CouponType findCouponTypeById(String id);

    List<Coupon> findUserCoupons(String openid, String token);

    //根据过期时间获取优惠券
    List<Coupon> GetCouponByExpiredTime(String expiredTime, String account);
    //修改发送状态
    Integer updateIsSend(String id);


}
